/*
 * @Date: 2023-03-11 16:46:29
 * @LastEditors: Zireael 1193875164@qq.com
 * @LastEditTime: 2023-03-11 16:54:36
 * @FilePath: \A19\backend\src\api\Experiment\ApiGetExp.ts
 */
import { ApiCall } from "tsrpc";
import { ReqGetExp, ResGetExp } from "../../shared/protocols/Experiment/PtlGetExp";
import { Global } from '../../Global/index';

export default async function (call: ApiCall<ReqGetExp, ResGetExp>) {
    // TODO
    const course = call.req.course

    const ret = await Global.collection('experiments').find({
        course:course
    }).toArray()

    call.succ({
        exps:ret
    })
}